#if !defined(__CAM_VIDEO_H_)
#define __CAM_VIDEO_H_

#define VIDEO_RECORD_WIDTH   144
#define VIDEO_RECORD_HEIGHT  176

#define USED_RECORD_FREAMS 2
#define GET_VIDEOBUFFER_ID(n) (n & (USED_RECORD_FREAMS - 1))



class CCamVideo
{
    public:
        BYTE *m_OutFramesBuffer;
        int m_iWidth;
        int m_iHeight;
        unsigned int m_uOutFrameID;
        unsigned int m_uInFrameID;
        unsigned long m_ulRecordBufFrameLen;
        IEvent *m_pFrameCopyEvent;
        Uint16 *m_VideoAppBuffer[USED_RECORD_FREAMS];
        CAMERA_MODE m_mode;
    private:
        ECode CreateBuffer(int iWidth, int iHeight);
        void  FreeBuffer();
    public:
        CCamVideo();
        ECode Initialize(CAMERA_MODE mode);
        void  Destroy();
        ECode Start(int iWidth, int iHeight, IEvent ** ppOutEvent);
        void  DoWork(void *pFrameBuffer);
        ECode Stop();
        ECode GetFrame(Camera_ImageFrame* pFrame);
};

#endif //__CAM_VIDEO_H_
